package com.cy.milktea.mapper;


import com.cy.milktea.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    int insert(User user);

    int delete(Integer id);

    int update(User user);

    List<User> select(@Param("name") String name, @Param("roleId") Integer roleId, @Param("valid") Integer valid);

    @Select("select count(*) from tb_user where roleId = #{roleId}")
    int selectCountRoleId(Integer roleId);

    User selectByUsername(String username);
}
